from django.template import Library

register = Library()

@register.filter
def dl(strlist):
    return ', '.join(strlist)

@register.filter(name='en_month')
def en_month(month, shorten='s'):
    m = {
         '1': ('Jan', 'January'),
         '2': ('Feb', 'February'),
         '3': ('Mar', 'March'),
         '4': ('Apr', 'April'),
         '5': ('May', 'May'),
         '6': ('Jun', 'June'),
         '7': ('Jul', 'July'),
         '8': ('Aug', 'August'),
         '9': ('Sep', 'September'),
         '10': ('Oct', 'October'),
         '11': ('Nov', 'November'),
         '12': ('Dec', 'December'),
         }
    i = 0 if shorten=='s' else 1
    return m.get(month, '1')[i]